package com.sxt.springboot.config;

import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

public class WebMvcConfig implements WebMvcConfigurer{

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
	LoginInterceptor interceptor=new LoginInterceptor();
	//注册
	registry.addInterceptor(interceptor).addPathPatterns("/**")
	.excludePathPatterns("/index.jsp","/login/toLogin","/login/login","/resources/**");
	
}
}
//解决原来的拦截器导致的静态资源表无法访问